#include "animated_graphic.h"
#include <SDL.h>

AnimatedGraphic::AnimatedGraphic() : BoardObject()
{
    
}

void AnimatedGraphic::load(std::unique_ptr<LoaderParams> const &pParams)
{
    BoardObject::load(pParams);
    m_animSpeed = pParams->getAnimSpeed();
    m_scale = pParams->getScale();
}

void AnimatedGraphic::draw()
{
    BoardObject::draw();
}

void AnimatedGraphic::update()
{
    m_currentFrame = static_cast<int>((SDL_GetTicks() / (1000 / m_animSpeed)) % m_numFrames);
}

void AnimatedGraphic::clean()
{
    BoardObject::clean();
}
